<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Class API : Admin - Food Option</title>

<style type='text/css' media='all'>@import url('./userguide.css');</style>
<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />

<meta http-equiv='expires' content='-1' />
<meta http-equiv= 'pragma' content='no-cache' />

</head>
<body>

<!-- START NAVIGATION -->
<a name="top"></a>
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
<td><h1>POS Class API</h1></td>
</tr>
</table>
</div>
<!-- END NAVIGATION -->


<!-- START BREADCRUMB -->
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
<td id="breadcrumb">
<a href="../index.html">Class API Home</a> &nbsp;&#8250;&nbsp;
Admin - Food Option
</td>
</tr>
</table>
<!-- END BREADCRUMB -->

<br clear="all" />


<!-- START CONTENT -->
<div id="content">


<h1><span class="class_tag">class</span> food_option</h1>

<p>food option class</p>

<h3>Table Of Contents</h3>

<ul>
	<li><a href="#using">Using The food_option Class</a></li>
	<li><a href="#function">Function Reference</a></li>
</ul>

<a name="using"></a>
<h2>Using The food_option Class</h2>

<p>How to access it in controller|model class</p>


<pre>
class anycontroller extends CI_Controller {

	public function anyaction() {

        // class will be available in $this->food_option

        $this->load->model('food_option_model', 'food_option');
	}
}
</pre>
<a name="function"></a>
<h1>Function Reference</h1>

<h2><span class="public_function">public</span> <span class="function_tag">function </span>get_option($food_option_category_id, $size=9999, $offset=0, $encode_html = true)</h2>
<p>retrieve first 9999 food options from a certain category and encode html as default. </p>
<code>
$this->food_option->get_option();
</code>

<h2><span class="public_function">public</span> <span class="function_tag">function </span>create($category_id, $en_name, $ch_name, $sequence, $price)</h2>
<p>create a new food option in database</p>
<code>
$this->food_option->create($params);
</code>

<h2><span class="public_function">public</span> <span class="function_tag">function </span>read($id, $encode_html = true)</h2>
<p>get single food option information and encode html as default</p>
<code>
$this->food_option->read($id);
</code>

<h2><span class="public_function">public</span> <span class="function_tag">function </span>update($id, $category_id, $en_name, $ch_name, $sequence, $price)</h2>
<p>update food option</p>
<code>
$this->food_option->update($params);
</code>

<h2><span class="public_function">public</span> <span class="function_tag">function </span>delete($id)</h2>
<p>delete a food option</p>
<code>
$this->food_option->delete($id);
</code>

<h2><span class="public_function">public</span> <span class="function_tag">function </span>swap($from_id, $to_id)</h2>
<p>swap 2 food options' sequence position</p>
<code>
$this->food_option->swap($from, $to);
</code>

</div>
<!-- END CONTENT -->


<div id="footer">
<p>
<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
<a href="../index.html">Class API Home</a>
</p>
<p><a href="http://codeigniter.com">Template Base On CodeIgniter</a> &nbsp;&middot;&nbsp; Created By Chen Daping - dapingc@hotmail.com&nbsp;&middot;&nbsp; <a rel="license" href="http://creativecommons.org/licenses/by/3.0/"></a><a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a></p>
</div>

</body>
</html>
